export type HostType =
  | "frontend"
  | "backend"
  | "database"
  | "cache"
  | "other"
  | "dev"
  | "test"
  | "prod";

export const HOST_TYPE_NAMES: Record<HostType, string> = {
  frontend: "前端",
  backend: "后端",
  database: "数据库",
  cache: "缓存",
  other: "其他",
  dev: "开发",
  test: "测试",
  prod: "生产",
};

export interface HostTypeDefinition {
  id: string;
  code: HostType;
  name: string;
  description?: string;
  color: string;
  icon: string;
  createdAt: string;
}

export interface Host {
  id: string;
  ip: string;
  domain: string;
  title: string;
  departmentId: string;
  projectId: string;
  type: HostType;
  description?: string;
  lastUpdated: string;
  isComment?: boolean;
  commentText?: string;
  hostContent?: string;
}

export interface Department {
  id: string;
  name: string;
  code: string;
  description?: string;
  color?: string;
}

export interface Project {
  id: string;
  name: string;
  departmentId: string;
  environment: string;
  description?: string;
  createdAt: string;
}

export interface Module {
  id: string;
  name: string;
  projectId: string;
  description?: string;
  createdAt: string;
}

export interface HostsBlock {
  id: string;
  name: string;
  projectId: string;
  moduleId?: string;
  content: string;
  description?: string;
  environment: string;
  createdAt: string;
  updatedAt: string;
  createdBy: string;
}

export interface Log {
  id: string;
  action: string;
  targetType: string;
  targetId: string;
  targetName: string;
  userId: string;
  userName: string;
  timestamp: string;
  details: string;
}

export interface HostsFilter {
  search: string;
  department?: string;
  project?: string;
  environment?: string;
  type?: string;
}
